#include "my_update.h"

My_update::My_update(QWidget *parent) : QGroupBox(parent)
{
    btn_version = new QPushButton("程序版本", this);
    btn_version->setObjectName("update");

    btn_path = new QPushButton("升级文件路径", this);
    btn_path->setObjectName("update");

    btn_update = new QPushButton("开始升级", this);
    btn_update->setObjectName("update");

    lab_version = new QLabel("未读取到版本", this);
    lab_version->setAlignment(Qt::AlignCenter);
    lab_version->setObjectName("lab_version");

    line_path = new QLineEdit(this);
    line_path->setObjectName("line_path");

    progress = new QProgressBar(this);
    progress->setValue(60);

    box = new QGridLayout();
    box->setContentsMargins(LEFT_M*5, TOP_M*10, RIGHT_M*5, BOTTOM_M*10);
    box->setSpacing(SPACE_SON*5);

    box->addWidget(btn_version, 0, 0, 1, 1, Qt::AlignCenter);
    box->addWidget(btn_path, 1, 0, 1, 1, Qt::AlignCenter);
    box->addWidget(btn_update, 2, 0, 1, 1, Qt::AlignCenter);

    box->addWidget(lab_version, 0, 1, 1, 3, Qt::AlignCenter);
    box->addWidget(line_path, 1, 1, 1, 3, Qt::AlignCenter);
    box->addWidget(progress, 2, 1, 1, 3, Qt::AlignCenter);

    this->setLayout(box);

}
